package com.hoangkien.adapter;

import com.mango.hoangkien.coloringkids.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;

public class SettingAdapter extends ArrayAdapter<Integer>{
	private Context context;
	private Integer[] arrDraw;
	private ImageView img;

	public SettingAdapter(Context context, int resource, Integer[] objects) {
		super(context, resource, objects);
		this.context = context;
		this.arrDraw = objects;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.spinner_adapter, parent,false);
		img = (ImageView) rowView.findViewById(R.id.text1);
		img.setBackgroundResource(arrDraw[position]);
		return rowView;
	}

}
